package cn.getech.data.development.entity.permission;

import cn.getech.data.development.entity.TableInfo;
import lombok.Data;

import java.util.List;

 /**
  * @description: 数据仓库表数据权限实体
  * @author: wangzhaowen：kiss
  * @create: 2020/7/31 14:26
  * @version: 2020/7/31
  **/
@Data
public class TableInfoPermission extends SysRoleDataPermission {



    /**
     * 表名称
     */
    private String chName;

    /**
     * 英文名称
     */
    private String enName;


    private List<TableFieldInfoPermission> tableFieldInfos;

     /**
      * 表密级信息
      */
     private String levelName;

     public TableInfoPermission( ) {
     }

     public TableInfoPermission(TableInfo record, SysRoleDataPermission sysRoleDataPermission) {
         if (record != null) {
             setEnName(record.getTableName());
             setChName(record.getTableAlias());
             setLevelName(record.getLevelName());
             setDataId(record.getId());
         }
         if (sysRoleDataPermission != null) {
             setQuery(sysRoleDataPermission.getQuery());
             setCreate(sysRoleDataPermission.getCreate());
             setUpdate(sysRoleDataPermission.getUpdate());
             setDelete(sysRoleDataPermission.getDelete());
             setAssign(sysRoleDataPermission.getAssign());
             setDecrypt(sysRoleDataPermission.getDecrypt());
             setExport(sysRoleDataPermission.getExport());
             setRoleId(sysRoleDataPermission.getRoleId());
             setDataType(sysRoleDataPermission.getDataType());
             setId(sysRoleDataPermission.getId());
             setWrite(sysRoleDataPermission.getWrite());
         }
     }


 }
